﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace site
{
	public class utils
	{
	private static IQueryable<User> GetUserByToken(string token)
	{
		DataClassesDataContext dc = new DataClassesDataContext(ConfigurationManager.ConnectionStrings["MultimonOnlineConnectionString"].ConnectionString);
		return (from u in dc.Users
			   where u.LiveToken == token
			   select u).Take(1);
	}
	private static IQueryable<Rig> GetRigsByUser(ref User U)
	{
		return GetRigsByUser(U.ID);
	}
	private static IQueryable<Rig> GetRigsByUser(int UID)
	{
		DataClassesDataContext dc = new DataClassesDataContext(ConfigurationManager.ConnectionStrings["MultimonOnlineConnectionString"].ConnectionString);
		return (from r in dc.Rigs 
			   where r.UID == UID
				   select r).Take(1);
	}

	}
}